home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / public / fax / src / faxd / Class2Params.h < prev    next >
C/C++ Source or Header  |  1994-08-01  |  4KB  |  84 lines

  1. /*    $Header: /usr/people/sam/fax/faxd/RCS/Class2Params.h,v 1.8 1994/02/28 14:14:22 sam Rel $ */
  2. /*
  3.  * Copyright (c) 1990, 1991, 1992, 1993, 1994 Sam Leffler
  4.  * Copyright (c) 1991, 1992, 1993, 1994 Silicon Graphics, Inc.
  5.  *
  6.  * Permission to use, copy, modify, distribute, and sell this software and 
  7.  * its documentation for any purpose is hereby granted without fee, provided
  8.  * that (i) the above copyright notices and this permission notice appear in
  9.  * all copies of the software and related documentation, and (ii) the names of
  10.  * Sam Leffler and Silicon Graphics may not be used in any advertising or
  11.  * publicity relating to the software without the specific, prior written
  12.  * permission of Sam Leffler and Silicon Graphics.
  13.  * 
  14.  * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, 
  15.  * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY 
  16.  * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  
  17.  * 
  18.  * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
  19.  * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
  20.  * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  21.  * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF 
  22.  * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 
  23.  * OF THIS SOFTWARE.
  24.  */
  25. #ifndef _Class2Params_
  26. #define    _Class2Params_
  27. /*
  28.  * Class 2 T.30 parameter wrapper.
  29.  */
  30. #include "class2.h"
  31. #include "Str.h"
  32.  
  33. struct Class2Params {
  34.     u_int vr;        // vertical resolution (VR_*)
  35.     u_int br;        // bit rate (BR_*)
  36.     u_int wd;        // page width (WD_*)
  37.     u_int ln;        // page length (LN_*)
  38.     u_int df;        // data format (DF_*)
  39.     u_int ec;        // error correction protocol (EC_*)
  40.     u_int bf;        // binary file transfer protocol (BF_*)
  41.     u_int st;        // minimum scanline time (ST_*)
  42.  
  43. // tables for mapping Class 2 codes to T.30 DIS/DCS codes
  44.     static u_int vrDISTab[2];        // vertical resolution
  45.     static u_int dfDISTab[4];        // data compression format
  46.     static u_int wdDISTab[8];        // page width
  47.     static u_int lnDISTab[3];        // page length
  48.     static u_int stDISTab[8];        // min scanline time (DIS specific)
  49.     static u_int stDCSTab[8];        // min scanline time (DCS specific)
  50.     static u_int brDISTab[8];        // bit rate (DIS specific)
  51.     static u_int brDCSTab[8];        // bit rate (DCS specific)
  52. // tables for mapping T.30 DIS/DCS values to Class 2 codes
  53.     static u_int DISvrTab[2];        // vertical resolution
  54.     static u_int DISdfTab[2];        // data compression format
  55.     static u_int DISwdTab[4];        // page width
  56.     static u_int DISlnTab[4];        // page length
  57.     static u_int DISstTab[8];        // min scanline time
  58.     static u_int DISbrTab[16];        // DIS best bit rate
  59.     static u_int DCSbrTab[16];        // DIS actual bit rate
  60.  
  61. // tables for printing class 2 subparameter information
  62.     static const char* bitRateNames[8];        // br codes
  63.     static const char* dataFormatNames[4];    // df codes
  64.     static const char* vresNames[2];        // vr codes
  65.     static const char* pageWidthNames[8];    // wd codes
  66.     static const char* pageLengthNames[4];    // ln codes
  67.     static const char* scanlineTimeNames[8];    // st codes
  68.  
  69.     Class2Params();
  70.  
  71.     int operator==(const Class2Params&) const;
  72.     int operator!=(const Class2Params&) const;
  73.  
  74.     fxStr cmd() const;    // format AT+F string for current parameters
  75.     void setFromDIS(u_int dis, u_int xinfo = 0);
  76.     void setFromDCS(u_int dcs, u_int xinfo = 0);
  77.     u_int getDCS() const;
  78.     fxBool is2D() const;
  79.  
  80.     u_int transferSize(u_int ms) const;
  81.     u_int minScanlineSize() const;
  82. };
  83. #endif /* _Class2Params_ */
  84.